var url = require("url");
// console.log(url);

var { URL } = url;
// console.log(URL);

var str = "https://www.baidu.com/index.html?user=a123123&pwd=123123#one";
var obj = new URL(str);
console.log(obj);

var searchParams = obj.searchParams;
console.log(searchParams.get("user"));
console.log(searchParams.get("pwd"));